/*
 * File: MultiWordAdd.c
 *
 * Code generated for Simulink model 'TABL'.
 *
 * Model version                  : 3.213
 * Simulink Coder version         : 9.4 (R2020b) 29-Jul-2020
 * C/C++ source code generated on : Thu Apr 28 14:14:16 2022
 */

#include "rtwtypes.h"
#include "MultiWordAdd.h"

void MultiWordAdd(const uint32_T u1[], const uint32_T u2[], uint32_T y[],
                  int32_T n)
{
    int32_T i;
    uint32_T carry = 0U;
    uint32_T u1i;
    uint32_T yi;
    for (i = 0; i < n; i++)
    {
        u1i = u1[i];
        yi = (u1i + u2[i]) + carry;
        y[i] = yi;
        carry = carry != 0U ? (uint32_T)(yi <= u1i) : (uint32_T)(yi < u1i);
    }
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
